import axios from '../../../plugins/axios'
import { LinkActionsEnum } from '../../../_/vue/store/link'
export default {
  [LinkActionsEnum.LIST] ({ commit }, params) {
    return axios.get('/links', { params })
  },
  [LinkActionsEnum.STORE] ({ commit }, data) {
    return axios.post('/links', data)
  },
  [LinkActionsEnum.EDIT] ({ commit }, id) {
    return axios.get(`/links/${id}`)
  },
  [LinkActionsEnum.SAVE] ({ commit }, payload) {
    return axios.post(`/links/${payload.id}`, payload.data)
  },
  [LinkActionsEnum.DELETE] ({ commit }, ids) {
    return axios.delete('/links', { data: ids })
  },
  [LinkActionsEnum.SWITCH] ({ commit }, data) {
    return axios.post('/links/switch', data)
  }
}
